import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { Observable, of } from 'rxjs';

class User {
    login: string;
    id: number;
    avatar_url: string;
}

@Injectable({
  providedIn: 'root',
})

export class GetUserService {
    githubApiUrl = 'https://api.github.com';
    constructor(private httpClient: HttpClient) {}

    getUser(url = 'https://api.github.com', config?: any): Observable<User[]> {
        return this.httpClient.get<User[]>(url);
    }
}
